package com.prime.tutorial.moviestore.view.logistics;

import com.prime.tutorial.moviestore.domain.Device;
import com.prime.tutorial.moviestore.service.logistics.LogisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("listDevicesForDeletion")
@Scope("request")
public class ListDevicesForDeletion {
    private LogisticsService logisticsService;
    private List<Device> devicesToDelete;

    @Autowired
    public ListDevicesForDeletion(LogisticsService logisticsService) {
        setLogisticsService(logisticsService);
        setDevicesToDelete(logisticsService.getDevicesOnStorage());
    }



    public LogisticsService getLogisticsService() {
        return logisticsService;
    }

    public void setLogisticsService(LogisticsService logisticsService) {
        this.logisticsService = logisticsService;
    }

    public List<Device> getDevicesToDelete() {
        return devicesToDelete;
    }

    public void setDevicesToDelete(List<Device> devicesToDelete) {
        this.devicesToDelete = devicesToDelete;
    }
}
